package utils;

import net.HttpRequest;
import net.sf.json.JSONObject;

import java.io.*;

public class TestUtil {
    public static void main(String[] args) {
        try {
            String url = Thread.currentThread().getContextClassLoader().getResource("AnnotationFiles/CreateModelAndStartTask.json").getPath();
            BufferedReader bufferedReader = new BufferedReader(new FileReader(new File(url)));
            String jsonString = null;
            StringBuilder json = new StringBuilder();
            while ((jsonString = bufferedReader.readLine()) != null) {
                json.append(jsonString);
            }
            JSONObject jsonObject = JSONObject.fromObject(json.toString());
            String data = jsonObject.getJSONObject("data").toString();
            System.out.println(HttpRequest.sendPost("http://localhost:8080/JCPT/ws/task/no_model_start","data="+data));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
